import fly from 'flyio'

export default {
  get (url, params = null) {
    return fly.get(url, params)
      .then((response) => {
        return response.data
      })
  },
  post (url, payload = null) {
    return fly.post(url, payload)
      .then((response) => {
        return response.data
      })
  },
  all (requests = []) {
    return fly.all(requests).then(fly.spread((...res) => res))
  }
}